#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

//纯暴力28分
using namespace std;
int n;
string ss;

const long long mod = 998244353;

string num = "2";

void change()
{
    string s;
    for (int i = 0; i < num.size(); i++)
    {
        if (num[i] - '0' == 2)
        {
            s += "4";
        }
        else if (num[i] - '0' == 4)
        {
            s += "16";
        }
        else if (num[i] - '0' == 1)
        {
            s += "2";
        }
        else
        {
            s += "64";
        }
    }
    num = s;
}

void clac()
{
    long long count = 0;
    int begin = 0;
    while ((begin = num.find(ss, begin)) != string::npos)
    {
        count++;
        begin++;
        count = count % mod;
    }
    cout << count << endl;
}

int main()
{
    cin >> n >> ss;
    for (int i = 0; i < n - 1; i++)
    {
        change();
    }
    clac();
    //system("pause");
}